<template>
	<view class="p_box">
		<view class="passwordbox" v-show="pShow">
			<view class="passwordmain">
				<view class="password_title">
					支付密码
				</view>
				<input type="password" v-model="password" placeholder="请输入支付密码">
				<view class="btns">
					<view class="cancel" @click="closeBox">
						取消
					</view>
					<view class="sure" @click.stop="getpassword">
						确认
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			pShow: {
				type: Boolean,
				default: false
			}
		},
		data() {
			return {
				// pShow: false,
				password: ''
			}
		},
		onLoad() {

		},
		methods: {
			closeBox() {
				this.$emit('closeBox', false)
			},
			getpassword() {
				this.$emit('getpassword', this.password)
				this.password = ''
			}
		}
	}
</script>

<style lang="scss">
	.passwordbox {
		position: fixed;
		width: 100%;
		left: 0;
		height: 100vh;
		background: #0000003b;
		top: 0;
		z-index: 9;

		.passwordmain {
			position: fixed;
			z-index: 999;
			background: #fff;
			width: 94%;
			left: 3%;
			padding: 40px 10px;
			box-sizing: border-box;
			border-radius: 8px;
			top: 25%;

			.password_title {
				font-size: 14px;
				font-weight: bold;
				border-bottom: 1px solid #ccc;
				padding-bottom: 8px;
			}

			input {
				margin-top: 10px;
				font-size: 14px;
				padding: 10px;
			}

			.btns {
				display: flex;
				justify-content: space-around;
				margin-top: 15px;

				.cancel {
					width: 40%;
					text-align: center;
					height: 40px;
					line-height: 40px;
					color: #798AD6;
					border: 1px solid #798AD6;
					border-radius: 8px;
				}

				.sure {
					width: 40%;
					text-align: center;
					height: 40px;
					line-height: 40px;
					border: 1px solid #798AD6;
					background-color: #798AD6;
					border-radius: 8px;
					color: #fff;
				}
			}
		}


	}
</style>